<template>
  <div class="screenfull">
    <!-- 放置一个svg的图标 -->
    <svg-icon icon-class="fullscreen" style="color:#fff; width: 20px; height: 20px" @click="screenFull" />
  </div>
</template>

<script>
import screenfull from 'screenfull'
export default {
  methods: {
    screenFull() {
      // 先判断浏览器是否支持全屏
      if (screenfull.isEnabled) {
        screenfull.toggle() // 全屏切换
      }
    }
  }
}
</script>

<style scoped lang="scss">
.screenfull {
  margin: 3px 10px 0px 10px;
}
</style>
